package helloworld.common;

import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;

/**
 * 
 * @author TUYEN-DM
 * <p>2009/04/20</p>
 * <p>Common class for Database query</p>
 */
public class DbSQLCommon {
	
	/**
	 * 
	 * @param strResourceFileName
	 * @param strResourceID
	 * @return strSQL got from resource file
	 */
	public String fncGetResourceSQL(String strResourceFileName,String strResourceID){
		String strSQL="";
		
		Properties prop = new Properties();
		ResourceBundle resource = ResourceBundle.getBundle(strResourceFileName);
		Enumeration enumTemp = resource.getKeys();
		while (enumTemp.hasMoreElements()) {
			String key = (String) enumTemp.nextElement();
			prop.put(key, resource.getString(key));
		}	
		
		strSQL = prop.getProperty(strResourceID);
		
		return strSQL;
	}

}
